package dao;

import pojo.Favourite;

import java.sql.SQLException;
import java.util.ArrayList;

public interface FavouriteDao {
    /**
     * 获取数据库某用户favourite表数据
     *
     * @param uid
     * @return
     * @throws SQLException
     * @throws ClassNotFoundException
     */
    ArrayList<Favourite> favouriteList(Integer uid) throws SQLException, ClassNotFoundException;

    /**
     * 收藏笔记
     *
     * @param uid
     * @param nid
     * @return
     * @throws SQLException
     */
    boolean UserFavouriteNote(Integer uid, Integer nid) throws SQLException;

    /**
     * 某笔记收藏数
     *
     * @param nid
     * @return
     * @throws SQLException
     */
    Integer noteFavouriteTotal(Integer nid) throws SQLException;

    /**
     * 根据rid和uid查询收藏信息
     *
     * @param uid
     * @param nid
     * @return
     * @throws SQLException
     */
    boolean findFavourite(Integer uid, Integer nid) throws SQLException;

    /**
     * 取消收藏
     *
     * @param uid
     * @param nid
     * @return
     * @throws SQLException
     */
    boolean UserUnFavourite(Integer uid, Integer nid) throws SQLException;
}
